# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WebSecurityScanner.V1alpha.Model.ScanConfig do
  @moduledoc """
  A ScanConfig resource contains the configurations to launch a scan. next id: 12

  ## Attributes

  *   `authentication` (*type:* `GoogleApi.WebSecurityScanner.V1alpha.Model.Authentication.t`, *default:* `nil`) - The authentication configuration. If specified, service will use the authentication configuration during scanning.
  *   `blacklistPatterns` (*type:* `list(String.t)`, *default:* `nil`) - The excluded URL patterns as described in https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. The user provided display name of the ScanConfig.
  *   `latestRun` (*type:* `GoogleApi.WebSecurityScanner.V1alpha.Model.ScanRun.t`, *default:* `nil`) - Latest ScanRun if available.
  *   `maxQps` (*type:* `integer()`, *default:* `nil`) - The maximum QPS during scanning. A valid value ranges from 5 to 20 inclusively. If the field is unspecified or its value is set 0, server will default to 15. Other values outside of [5, 20] range will be rejected with INVALID_ARGUMENT error.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The resource name of the ScanConfig. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are generated by the system.
  *   `schedule` (*type:* `GoogleApi.WebSecurityScanner.V1alpha.Model.Schedule.t`, *default:* `nil`) - The schedule of the ScanConfig.
  *   `startingUrls` (*type:* `list(String.t)`, *default:* `nil`) - Required. The starting URLs from which the scanner finds site pages.
  *   `targetPlatforms` (*type:* `list(String.t)`, *default:* `nil`) - Set of Google Cloud platforms targeted by the scan. If empty, APP_ENGINE will be used as a default.
  *   `userAgent` (*type:* `String.t`, *default:* `nil`) - The user agent used during scanning.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authentication => GoogleApi.WebSecurityScanner.V1alpha.Model.Authentication.t() | nil,
          :blacklistPatterns => list(String.t()) | nil,
          :displayName => String.t() | nil,
          :latestRun => GoogleApi.WebSecurityScanner.V1alpha.Model.ScanRun.t() | nil,
          :maxQps => integer() | nil,
          :name => String.t() | nil,
          :schedule => GoogleApi.WebSecurityScanner.V1alpha.Model.Schedule.t() | nil,
          :startingUrls => list(String.t()) | nil,
          :targetPlatforms => list(String.t()) | nil,
          :userAgent => String.t() | nil
        }

  field(:authentication, as: GoogleApi.WebSecurityScanner.V1alpha.Model.Authentication)
  field(:blacklistPatterns, type: :list)
  field(:displayName)
  field(:latestRun, as: GoogleApi.WebSecurityScanner.V1alpha.Model.ScanRun)
  field(:maxQps)
  field(:name)
  field(:schedule, as: GoogleApi.WebSecurityScanner.V1alpha.Model.Schedule)
  field(:startingUrls, type: :list)
  field(:targetPlatforms, type: :list)
  field(:userAgent)
end

defimpl Poison.Decoder, for: GoogleApi.WebSecurityScanner.V1alpha.Model.ScanConfig do
  def decode(value, options) do
    GoogleApi.WebSecurityScanner.V1alpha.Model.ScanConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WebSecurityScanner.V1alpha.Model.ScanConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
